package com.my.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.my.annotation.UserAnnotation;
import com.my.bean.User;
import com.my.mapper.UserMapper;
import com.my.service.UserService;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @author marshal
 * @date 2021-06-08
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Override
    @UserAnnotation
    public User addUser(User user) {
        user.setCreateTime(new Date());
        user.setUpdateTime(new Date());
        save(user);
        return user;
    }

    @Override
    public void detail(Long id) {
        System.out.println(getById(id));
    }

}
